package com.young.common.core.log.handler;

import com.young.interfaces.log.model.LogDTO;
import com.young.interfaces.log.service.ILogHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 基础日志处理器
 * Created by rookie on 2017/11/10.
 */
public class BasicLogHandler implements ILogHandler {

    private static final Logger logger = LoggerFactory.getLogger(BasicLogHandler.class);

    @Override
    public void handleBefore(LogDTO logDTO) {

    }

    @Override
    public void handle(LogDTO logDTO) {
        logger.info("[{}]-请求时间{}-类{}-方法{}-响应时间{}ms", logDTO.getLog().value(), logDTO.getBeginTime(), logDTO.getClassName(), logDTO.getMethodName(), logDTO.getMs());
    }

    @Override
    public void handleAfter(LogDTO logDTO) {

    }
}
